﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using InterfaceOperacion;

namespace PluginPotencia
{
    public class Potencia : InterfacePlugin
    {
        public string simbolo { get { return "Pot"; } }

        public double operar(double a, double b)
        {
            if (a == 0) return 0;
            if (b == 0) return 1;
            else
            {
                if (b > 0)
                {
                    return a * operar(a, b - 1);
                }
                else
                {
                    return (1 / a) * operar(a, b + 1);
                }
            }
        }
    }
}
